Public Class logging
    Public Event writeToLog(ByVal str As String)

    Sub startLogging()
        RaiseEvent writeToLog(Now() & " [" & Threading.Thread.CurrentThread.Name & "]" & vbCrLf)
        RaiseEvent writeToLog("Starting log..." & vbCrLf)
    End Sub

    Sub stopLogging()
        RaiseEvent writeToLog(Now() & " [" & Threading.Thread.CurrentThread.Name & "]" & vbCrLf)
        RaiseEvent writeToLog("Stopping log..." & vbCrLf)
    End Sub

    Sub write(ByVal str As String)
        RaiseEvent writeToLog(Now() & " [" & Threading.Thread.CurrentThread.Name & "]" & vbCrLf)
        RaiseEvent writeToLog(str & vbCrLf)
    End Sub
End Class
